package com.tangmu.rabbits.ui.activity.home;

import android.graphics.Typeface;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.tangmu.rabbits.R;
import com.tangmu.rabbits.adapter.home.BrandIflashbuyAdapter;
import com.tangmu.rabbits.base.BaseActivity;
import com.tangmu.rabbits.constants.Constants;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * 品牌闪购
 */
public class BrandIflashbuyActivity extends BaseActivity {

    protected Typeface mTypeface;

    @BindView(R.id.tv_global_ranking)
    TextView tvGlobal;
    @BindView(R.id.tv_global_hots)
    TextView tvGlobalHots;

    @BindView(R.id.brand_iflash_recycler)
    RecyclerView mRecyclerView;
    private BrandIflashbuyAdapter adapter;
    private List<Integer> datas = new ArrayList<>();

    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        mImmersionBar.statusBarColor(R.color.transparent).titleBar(R.id.headerView).init();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_brand_iflashbuy;
    }

    @Override
    protected void initPresenter() {

    }

    @Override
    protected void initView() {
        setHeaderImage(Constants.Position.LEFT, R.drawable.icon_back, false, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        setHeaderTitle("品牌闪购");
        setHeaderImage(Constants.Position.RIGHT, R.drawable.icon_refresh, false, new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        for (int i = 0; i < 3; i++) {
            datas.add(i);
        }

        mTypeface = Typeface.createFromAsset(getAssets(), "JWaWAZuan_Regular.ttf");
        tvGlobal.setTypeface(mTypeface);
        tvGlobalHots.setTypeface(mTypeface);

        mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext));
        mRecyclerView.setNestedScrollingEnabled(false);
        mRecyclerView.setFocusableInTouchMode(false);
        mRecyclerView.requestFocus();
        adapter = new BrandIflashbuyAdapter(mContext, datas);
        mRecyclerView.setAdapter(adapter);
    }
}
